	import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.io.UnsupportedEncodingException;

import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
import javax.swing.ButtonGroup;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;

import CLIPSJNI.Environment;


/* Implement FindFact which returns just a FactAddressValue or null */
/* TBD Add size method to PrimitiveValue */

class ResultadosEvaluacionAlumno extends JPanel {

    /**
     * 
     */
    private static final long serialVersionUID = -458966992772101939L;

    JLabel dLabel;

    JComboBox valor_C  ;
    JComboBox valor_H ;
    JComboBox valor_A  ;
    JComboBox valor_S ;
    JComboBox valor_I  ;
    JComboBox valor_D;
    JComboBox valor_E  ;
	
	
    JButton nextButton;
    JButton prevButton;
    JPanel choicesPanel;
    ButtonGroup choicesButtons;
    
	
	PrintWriter writer;

    Environment clips;

    public ResultadosEvaluacionAlumno()  {

        /* ================================ */
        /* Create a new JFrame container. */
        /* ================================ */

        final JFrame jfrm = new JFrame("TestVocacionalDemo");

        /* ============================= */
        /* Specify FlowLayout manager. */
        /* ============================= */

        jfrm.getContentPane().setLayout(new GridLayout(1, 1));

        /* ================================= */
        /* Give the frame an initial size. */
        /* ================================= */

        jfrm.setSize(750, 400);

        jfrm.setLocation(200, 100);

        /* ============================================================= */
        /* Terminate the program when the user closes the application. */
        /* ============================================================= */

        jfrm.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

        /* =========================== */
        /* Create the display panel. */
        /* =========================== */

        JPanel displayPanel = new JPanel();
        JLabel displayLabel = new JLabel();
        displayPanel.add(displayLabel);

        /* =========================== */
        /* Create the choices panel. */
        /* =========================== */

        choicesPanel = new JPanel();
        choicesPanel.setBorder(BorderFactory.createTitledBorder("Resultados de la evaluación escrita"));
       
        
        
        choicesPanel.setSize(750, 350);
        choicesPanel.setLayout(new BoxLayout(choicesPanel, BoxLayout.Y_AXIS));
        
		dLabel = new JLabel("Valor final de la Seccion C");
        choicesPanel.add(dLabel);
        valor_C = new JComboBox();
        valor_C.addItem("1");
        valor_C.addItem("2");
        valor_C.addItem("3");
		valor_C.addItem("4");
		valor_C.addItem("5");
		valor_C.addItem("6");
		valor_C.addItem("7");
		valor_C.addItem("8");
		valor_C.addItem("9");
		valor_C.addItem("10");
		valor_C.addItem("11");
		valor_C.addItem("12");
		valor_C.addItem("13");
		valor_C.addItem("14");
        choicesPanel.add(valor_C);

        dLabel = new JLabel("Valor final de la Seccion H");
        choicesPanel.add(dLabel);
        valor_H = new JComboBox();
		valor_H.addItem("1");
        valor_H.addItem("2");
        valor_H.addItem("3");
		valor_H.addItem("4");
		valor_H.addItem("5");
		valor_H.addItem("6");
		valor_H.addItem("7");
		valor_H.addItem("8");
		valor_H.addItem("9");
		valor_H.addItem("10");
		valor_H.addItem("11");
		valor_H.addItem("12");
		valor_H.addItem("13");
		valor_H.addItem("14");
		
        choicesPanel.add(valor_H);

        dLabel = new JLabel("Valor final de la Seccion A");
        choicesPanel.add(dLabel);
        valor_A = new JComboBox();
		valor_A.addItem("1");
        valor_A.addItem("2");
        valor_A.addItem("3");
		valor_A.addItem("4");
		valor_A.addItem("5");
		valor_A.addItem("6");
		valor_A.addItem("7");
		valor_A.addItem("8");
		valor_A.addItem("9");
		valor_A.addItem("10");
		valor_A.addItem("11");
		valor_A.addItem("12");
		valor_A.addItem("13");
		valor_A.addItem("14");
        choicesPanel.add(valor_A);

        dLabel = new JLabel("Valor final de la Seccion S");
        choicesPanel.add(dLabel);
        valor_S = new JComboBox();
		valor_S.addItem("1");
        valor_S.addItem("2");
        valor_S.addItem("3");
		valor_S.addItem("4");
		valor_S.addItem("5");
		valor_S.addItem("6");
		valor_S.addItem("7");
		valor_S.addItem("8");
		valor_S.addItem("9");
		valor_S.addItem("10");
		valor_S.addItem("11");
		valor_S.addItem("12");
		valor_S.addItem("13");
		valor_S.addItem("14");
        choicesPanel.add(valor_S);
		
		

        dLabel = new JLabel("Valor final de la Seccion I");
        choicesPanel.add(dLabel);
        valor_I = new JComboBox();
		valor_I.addItem("1");
        valor_I.addItem("2");
        valor_I.addItem("3");
		valor_I.addItem("4");
		valor_I.addItem("5");
		valor_I.addItem("6");
		valor_I.addItem("7");
		valor_I.addItem("8");
		valor_I.addItem("9");
		valor_I.addItem("10");
		valor_I.addItem("11");
		valor_I.addItem("12");
		valor_I.addItem("13");
		valor_I.addItem("14");
        choicesPanel.add(valor_I);
		
		
		dLabel = new JLabel("Valor final de la Seccion D");
        choicesPanel.add(dLabel);
        valor_D = new JComboBox();
		valor_D.addItem("1");
        valor_D.addItem("2");
        valor_D.addItem("3");
		valor_D.addItem("4");
		valor_D.addItem("5");
		valor_D.addItem("6");
		valor_D.addItem("7");
		valor_D.addItem("8");
		valor_D.addItem("9");
		valor_D.addItem("10");
		valor_D.addItem("11");
		valor_D.addItem("12");
		valor_D.addItem("13");
		valor_D.addItem("14");
        choicesPanel.add(valor_D);

       
		dLabel = new JLabel("Valor final de la Seccion E");
        choicesPanel.add(dLabel);
        valor_E = new JComboBox();
		valor_E.addItem("1");
        valor_E.addItem("2");
        valor_E.addItem("3");
		valor_E.addItem("4");
		valor_E.addItem("5");
		valor_E.addItem("6");
		valor_E.addItem("7");
		valor_E.addItem("8");
		valor_E.addItem("9");
		valor_E.addItem("10");
		valor_E.addItem("11");
		valor_E.addItem("12");
		valor_E.addItem("13");
		valor_E.addItem("14");
        choicesPanel.add(valor_E);
        /* =========================== */
        /* Create the buttons panel. */
        /* =========================== */

        
        try {
            writer = new PrintWriter("factsEvaluacion.clp", "UTF-8");

        } catch (FileNotFoundException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        } catch (UnsupportedEncodingException e1) {
            // TODO Auto-generated catch block
            e1.printStackTrace();
        }

        JPanel buttonPanel = new JPanel();



        nextButton = new JButton("Next");
        nextButton.setActionCommand("Next");
        choicesPanel.add(nextButton);
        nextButton.addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
				EndTestVocacionalDemo evaluacion = new EndTestVocacionalDemo();
                writer.println("(deffacts caso_6 " );
				writer.println("	(alumnos_evaluacion  " );
				writer.println("		(valor_C "+valor_C.getSelectedItem().toString()+")");
				writer.println("		(valor_H "+valor_H.getSelectedItem().toString()+")");
				writer.println("		(valor_A "+valor_A.getSelectedItem().toString()+")" );
				writer.println("		(valor_S "+valor_S.getSelectedItem().toString()+")");
				writer.println("		(valor_I "+valor_I.getSelectedItem().toString()+")");
				writer.println("		(valor_D "+valor_D.getSelectedItem().toString()+")");
				writer.println("		(valor_E "+valor_E.getSelectedItem().toString()+")))");
				writer.close();
				
				
				evaluacion.setVisible(true);
                jfrm.setVisible(false);

            }
        });

        /* ===================================== */
        /* Add the panels to the content pane. */
        /* ===================================== */

        jfrm.getContentPane().add(displayPanel);
        jfrm.getContentPane().add(choicesPanel);
        jfrm.getContentPane().add(buttonPanel);

        /* ==================== */
        /* Display the frame. */
        /* ==================== */

        jfrm.setVisible(true);
        displayLabel.setText("Run clips file");
        /* ================================== */
        /* Get the current state of the UI. */
        /* ================================== */

    }


}
